package cn.bdqn.first;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Description TODO
 * @Date 2020/2/11 11:58
 * @Created by 张三三
 */
public class Demo {
    public static void main(String[] args) {

        // Demo  如何去 获取 Person 对象

        // 1- 获取第三方对象 (容器中存放的是 对象)
        ApplicationContext app =
            new ClassPathXmlApplicationContext("applicationContext.xml");
        // 2- 从第三方对象中 获取想要找的对象
        // Person person1 = new Person();

        Person person = app.getBean(Person.class);
        person.play();

        Student student = app.getBean(Student.class);

        Teacher teacher = (Teacher)app.getBean("teacher");


    }
}
